namespace CloudNinja.Metering.Common.Configuration
{
    using System;
    using System.Configuration;

    public class ProvidersElement : ConfigurationElement
    {
        [ConfigurationProperty("DefaultCollectionInterval", IsRequired = true, DefaultValue = "03:00:00")]
        public TimeSpan DefaultCollectionInterval
        {
            get
            {
                return (TimeSpan)this["DefaultCollectionInterval"];
            }

            set
            {
                this["DefaultCollectionInterval"] = value;
            }
        }

        [ConfigurationProperty("Providers", IsDefaultCollection = false), ConfigurationCollection(typeof(ProviderElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
        public ProvidersCollection Providers
        {
            get
            {
                return this["Providers"] as ProvidersCollection;
            }

            set
            {
                this["Providers"] = value;
            }
        }
    }
}